/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.zb.hms.base.util.stringUtil;

import java.util.regex.Pattern;

import org.springframework.stereotype.Component;

/**
 *
 * @Description
 * @author zb
 * @datetime 2017-8-8 22:30:42
 * @version V1.0
 */
  @Component
  public  class  StringUtil {
       
    /* 判断是否是服务器请求*/
    public static Boolean  isUrl(String url) {
       return !Pattern.matches(RegexConstants.ISURL, url);
    }

      /* 取url中最后C子字符串及之后的字符串*/
    public static String getSuffix(String url, String c) {
       return url.substring(url.lastIndexOf(c), url.length());
    }

  
//    public static  Boolean isPub(String url){
//        return  url.substring(url.lastIndexOf("/"), url.length()).startsWith("Pub");
//    }
//    public static Boolean isUrl(String url){
//            
//        return url.endsWith(".")
//    }

      /* 判断是否是服务器Pub请求*/
    public static Boolean isPub(String url) {
        return getSuffix(url, "/").startsWith("/Pub");
    }
//       /* 判断是否是验证码请求*/
//    public static Boolean isVerifyCode(String url) {
//        return getSuffix(url, "/").startsWith();
//    }
       
}
